import Vue from 'vue'
import App from './App.vue'
import router from './router'
import VueI18n from 'vue-i18n'
import enLocale from 'element-ui/lib/locale/lang/en'
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
import tgLocale from 'element-ui/lib/locale/lang/km'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

Vue.use(ElementUI);
// 在this上生成$t ==> this.$t不能调用
Vue.use(VueI18n)

const i18n = new VueI18n({
  // 设置默认语言
  locale: 'zh',
  // 自己配置的语言
  messages: {
    'zh': {
      hello: "你好",
      ...zhLocale
    },
    'en': {
      hello: "HELLO",
      ...enLocale
    },
    'tg': {
      ...tgLocale
    }
  }
})

new Vue({
  router,
  i18n,
  render: h => h(App)
}).$mount('#app')
